package lab02.test03;

/**
 * Created by Jammy on 2017/10/15.
 */
public class Student {
    float computerScore;
    float mathScore;
    float EnglishScore;


    float sum(){

        return computerScore + mathScore + EnglishScore;
    }

    float average(){

        return (computerScore + mathScore + EnglishScore) /3;
    }

    float maxScore(){

        float max;

        if (computerScore > mathScore) {

            max = computerScore;
        }else {

            max = mathScore;
        }

        if (max < EnglishScore){

            max = EnglishScore;
        }

        return max;
    }

    float minScore(){

        float min;

        if (computerScore < mathScore) {

            min = computerScore;

        }else {

            min = mathScore;
        }

        if (min > EnglishScore){

            min = EnglishScore;
        }

        return min;
    }

    @Override
    public String toString() {
        return "计算机成绩:"+computerScore+" "+"数学成绩："+mathScore+" "+"英语成绩："+EnglishScore+"\t"+"总分："+sum()+" "+"平均分："+average()+" "+"最高分："+maxScore()+" "+"最低分："+minScore();

    }
}
